<!doctype html>
<html>
    <head>
    <meta charset="UTF-8">
    <title>跨浏览器剪贴功能</title>
    <style type="text/css">
		body{padding:30px;}
        p{margin-bottom:15px;}
        #tip{display:none;color:#080;font-size:12px;}
	</style>
</head>
<body>

<p>Copy to Clipboard: <br />
    <input id="text" size="40" value="http://aliceui.com"/>
    <span id="tip"></span>
</p> 

<input id="button" type="button" value="copy me!" />

<script type="text/javascript" src="ZeroClipboard.js"></script>
<script language="JavaScript">

        ZeroClipboard.setMoviePath('http://aliceui.com/demo/solutions/cross-browers-copy/ZeroClipboard.swf');

        var clip = new ZeroClipboard.Client(),
            doc = document,
            tip = doc.getElementById('tip'),
            text = doc.getElementById('text');
        
        clip.setText( '' ); // will be set later on mouseDown
        clip.setHandCursor( true );
                
        clip.addEventListener( 'complete', function(client, text) {
                tip.innerHTML = 'copied…';
                tip.style.display = 'inline';
                setTimeout(function(){
                    tip.style.display = 'none';
                }, 1000);
        } );
        
        clip.addEventListener( 'mouseDown', function(client) { 
                clip.setText( text.value );
        } );
        
        clip.glue( 'button' );
</script>
</body>
</html>